<!DOCTYPE html>
<head>
    <title>书本P380联系</title>
    <meta charset="UTF-8">
</head>
<body >
    <span id="tm"></span>
</body>
<script style="text/javascript">
    var loc=window.location;
    var locStr="当前的location信息是：\n";
    for (var proname in loc){
        locStr+=proname+":"+loc[proname]+"\n"
    }
    //alert(locStr);
    //alert(window.screen);
    var str="当前的屏幕信息是：\n";
    for(var proname in window.screen){
        str+=proname+":"+window.screen[proname]+"\n";
    }
    //alert(str);
    /*var width=window.screen.width;
    var height=window.screen.height;
    window.open("task_todo.html","_blank","left=0,top=0,width="+width+",height"+height+"toolbar=no,menubar=yes")
    window.close();
    name=prompt("请输入你的名字：","");
    document.getElementById('name').innerHTML = name;

    //定时器的使用
    var timer; //定义一个定时器变量
    var cur=new Date().getTime();
    var setTime=function(){
        document.getElementById('tm').innerHTML=new Date().toLocaleString(); //span的tm中显示当前时间
        if(new Date().getTime()-cur >60*1000){
            clearInterval(timer);
        }
    }
    timer=window.setInterval("setTime();",1000);
    //alert(window.navigator);
    var browser="当前的浏览器信息是：";
    for(propname in window.navigator){
        browser+=propname+":"+window.navigator[propname]+"\n"
    }
    alert(browser);
    //获取地理位置
    var geoHandler=function(position){
        var geoMsg="用户所在的地理位置信息是：<br>";
        geoMsg+="timestamp的属性为："+position.timestamp+"<br>" ;
        var coords=position.coords;
        for(var propname in coords){
            geoMsg+=propname+"-->"+"<br>";
        }    
        document.writeln(geoMsg);
       }
    var erroHandler=function(error){
        var errMsg={
            1:'用户拒绝位置服务',
            2:'无法获取位置信息',
            3:'获取位置信息超时'
        };
        alert(errMsg);
        alert(errMsg[error.code]);
    }
    //获取地理位置信息
    navigator.geolocation.getCurrentPosition(geoHandler,erroHandler,{enableHighAccuracy:true,maximumAge:1000})*/
    //document对象
    var load=function(){
        var now=new Date().getTime();
        var Page_load_time=now-performance.timing.navigationStart;
        alert("页面加载时间："+Page_load_time);
    }
    var show="performance的属性有：";
    for(var prop in performance){
        show+=prop+"\n";
    }
    alert(show);
</script>
</html>